#include <bits/stdc++.h>
using namespace std;
void debug() { cout << endl; }
template <class T, class... R>
void debug(T f, R... r) {
  cout << "[" << f << "]";
  debug(r...);
}
template <class T>
T mmin(T a, T b) {
  return min(a, b);
}
template <class T, class... R>
T mmin(T a, R... b) {
  return min(a, mmin(b...));
}
template <class T>
T mmax(T a, T b) {
  return max(a, b);
}
template <class T, class... R>
T mmax(T a, R... b) {
  return max(a, mmax(b...));
}
template <class T>
T mgcd(T a, T b) {
  return __gcd(a, b);
}
template <class T, class... R>
T mgcd(T a, R... b) {
  return __gcd(a, mgcd(b...));
}
void myin() {
  freopen("1.in", "r", stdin);
  freopen("1.out", "w", stdout);
}
namespace IO {
const int MX = 4e7;
char buf[MX];
int c, sz;
void begin() {
  c = 0;
  sz = fread(buf, 1, MX, stdin);
}
inline bool read(int &t) {
  while (c < sz && buf[c] != '-' && (buf[c] < '0' || buf[c] > '9')) c++;
  if (c >= sz) return false;
  bool flag = 0;
  if (buf[c] == '-') flag = 1, c++;
  for (t = 0; c < sz && '0' <= buf[c] && buf[c] <= '9'; c++)
    t = t * 10 + buf[c] - '0';
  if (flag) t = -t;
  return true;
}
}  // namespace IO
const int N = 1e5 + 5;
const int M = 1e5 + 5;
int a[300005], dp[300005][20], lst[25];
int main() {
  int n, q;
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  for (int i = n; i; --i) {
    for (int j = 0; j < 20; ++j) dp[i][j] = n + 1;
    for (int j = 0; j < 20; ++j)
      if ((1 << j) & a[i]) {
        if (lst[j]) {
          for (int k = 0; k < 20; ++k) dp[i][k] = min(dp[i][k], dp[lst[j]][k]);
        }
        lst[j] = i;
        dp[i][j] = i;
      }
  }
  while (q--) {
    int x, y, f = 0;
    scanf("%d%d", &x, &y);
    for (int i = 0; i < 20; ++i)
      if (((1 << i) & a[y]) && dp[x][i] <= y) f = 1;
    printf("%s\n", f ? "Shi" : "Fou");
  }
  return 0;
}
