#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
template <class T>
using V = vector<T>;
template <class T>
using VV = V<V<T>>;
constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); }
template <class T, class U>
void chmin(T& t, const U& u) {
  if (t > u) t = u;
}
template <class T, class U>
void chmax(T& t, const U& u) {
  if (t < u) t = u;
}
template <class T, class U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
  os << "(" << p.first << "," << p.second << ")";
  return os;
}
template <class T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  os << "{";
  for (int i = 0; i < (v.size()); i++) {
    if (i) os << ",";
    os << v[i];
  }
  os << "}";
  return os;
}
const int maxn = 300010;
const int INF = TEN(9);
int close[maxn][20];
int main() {
  int n, q;
  scanf("%d %d", &n, &q);
  V<int> a(n);
  for (int i = 0; i < (n); i++) scanf("%d", &a[i]);
  for (int i = 0; i < (n); i++)
    for (int j = 0; j < (20); j++) {
      close[i][j] = INF;
    }
  V<int> cur(20, INF);
  for (int i = n - 1; i >= 0; --i) {
    for (int j = 0; j < (20); j++)
      if (a[i] >> j & 1) {
        if (cur[j] != INF) {
          for (int k = 0; k < (20); k++) {
            chmin(close[i][k], close[cur[j]][k]);
          }
        }
        cur[j] = i;
        close[i][j] = i;
      }
  }
  while (q--) {
    int x, y;
    scanf("%d %d", &x, &y);
    --x;
    --y;
    bool ok = false;
    for (int j = 0; j < (20); j++) {
      if ((a[y] >> j & 1) and close[x][j] <= y) {
        ok = true;
      }
    }
    puts(ok ? "Shi" : "Fou");
  }
  return 0;
}
